package com.isoftstone.securityframework.device.auth;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.SimplePrincipalCollection;

import com.isoftstone.securityframework.device.Device;

@SuppressWarnings("serial")
public class DeviceAuthenticationInfo implements AuthenticationInfo{


    protected PrincipalCollection principals;
    public DeviceAuthenticationInfo(Object principal, String realmName) {
        this.principals = new SimplePrincipalCollection(principal, realmName);
    }

	@Override
	public PrincipalCollection getPrincipals() {
		return this.principals;
	}

	@Override
	public Object getCredentials() {
		return ((Device)this.principals.getPrimaryPrincipal()).getDeviceFlag();
	}
}
